/**
 * 图片相关操作
 */
const fs = require('fs')
const gm = require('gm')

const controller = {
  composite: () => {
    return new Promise((resolve, reject) => {
      fs.writeFile('static/', err => {
        gm().in('-page', '0,0')
        .in(require('../../static/bgu.jpg'))
        
      })
      console.log('合成图片开始')
      console.log('合成图片结束')
      resolve({
        code: 200,
        message: 'success',
        data: '图片url'
      })
    })
  }
}

module.exports = controller
